/**
 * Copyright (C) 2024
 * All rights reserved, Designed By www.joolun.com
 * 注意：
 * 本软件为www.joolun.com开发研制，未经购买不得使用
 * 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 * 一经发现盗用、分享等行为，将追究法律责任，后果自负
 */

import http from "@/api/api";

// 营业额 shopId：不传则整个商城的数据; isPay:固定值为1 
export function getPaymentpriceSum(query) {// query : '?shopId=0&isPay=1&beginTime=2020-05-05 00:00:00&endTime=2020-06-05 00:00:00'
  return http.request({
    url: '/mall/orderinfo/paymentprice/sum',
    method: 'get',
    params: query,
  })
}
export function getPage(query) {// query : '?page=0?pageSize=10'
  return http.request({
    url: '/mall/orderinfo/page',
    method: 'get',
    params: query
  })
}

export function getCount(query) {
  return http.request({
    url: '/mall/orderinfo/count',
    method: 'get',
    params: query,
	showLoading: false
  })
}

export function addObj(obj) {
  return http.request({
    url: '/mall/orderinfo',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return http.request({
    url: '/mall/orderinfo/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return http.request({
    url: '/mall/orderinfo/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return http.request({
    url: '/mall/orderinfo',
    method: 'put',
    data: obj
  })
}

export function editPrice(obj) {
  return http.request({
    url: '/mall/orderinfo/editPrice',
    method: 'put',
    data: obj
  })
}

export function orderCancel(id) {
  return http.request({
    url: '/mall/orderinfo/cancel/' + id,
    method: 'put'
  })
}

export function takeGoods(id) {
  return http.request({
    url: '/mall/orderinfo/takegoods/' + id,
    method: 'put'
  })
}

export function delivery(obj) {
  return http.requestNew("put", "/mall/orderinfo/delivery", { data: obj });
}